Skip to content

Conversation

@tcmulcahy
Copy link
Collaborator

Remove the dependency on papa.SafeTrace and replace it with androidx.tracing.Trace. This simplifies the dependency tree by using the standard AndroidX tracing library instead of the third-party Papa library. (Note: we have a test-only dependency on Papa still for papa.Choreographers)

The PapaSafeTrace class now delegates to androidx.tracing.Trace methods which provide equivalent functionality. The isCurrentlyTracing property now uses Trace.isEnabled() instead of
SafeTrace.isCurrentlyTracing, and logSection() now uses the trace {} inline function from androidx.tracing.ktx.

Remove the dependency on papa.SafeTrace and replace it with
androidx.tracing.Trace. This simplifies the dependency tree by
using the standard AndroidX tracing library instead of the
third-party Papa library. (Note: we have a test-only dependency on Papa
still for papa.Choreographers)

The PapaSafeTrace class now delegates to androidx.tracing.Trace
methods which provide equivalent functionality. The isCurrentlyTracing
property now uses Trace.isEnabled() instead of
SafeTrace.isCurrentlyTracing, and logSection() now uses the trace {}
inline function from androidx.tracing.ktx.
@tcmulcahy tcmulcahy marked this pull request as ready for review November 7, 2025 17:37
@tcmulcahy tcmulcahy requested review from a team and zach-klippenstein as code owners November 7, 2025 17:37
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
*/
class PapaSafeTrace(
override val isTraceable: Boolean = false
) : SafeTraceInterface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename this class then as it no longer uses Papa

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, totally. I'll prepare a separate PR to do so. How about s/PapaSafeTrace/WorkflowTrace and s/SafeTraceInterface/TraceInterface?


override val isCurrentlyTracing: Boolean
get() = SafeTrace.isCurrentlyTracing
get() = Trace.isEnabled()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does isEnabled go off and on based on whether we are actively recording a trace?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

@tcmulcahy tcmulcahy merged commit 42f75b5 into tomm/remove-safe-trace-is-traceable Nov 11, 2025
198 of 203 checks passed
@tcmulcahy tcmulcahy deleted the tomm/remove-papa-safetrace-usages branch November 11, 2025 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants